<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <link rel="stylesheet" href="../../css/font-awesome.min.css"/>
  <link rel="stylesheet" href="../../css/fa-font-awesome.min.css"/>
  <link rel="stylesheet" href="../../css/bootstrap.min.css"/>
  <link rel="stylesheet" href="../../css/animate.min.css"/>
  <link rel="stylesheet" href="../../css/appbase.css"/>
  <link rel="stylesheet" href="../../css/style.css"/>

  <link rel="stylesheet" href="../../plugins/chosen/chosen.min.css" />
  <link rel="stylesheet" href="../../plugins/icheck/custom.css" />
  <link rel="stylesheet" href="../../plugins/jsonview/jquery.jsonview.min.css" />
  <link rel="stylesheet" href="../../plugins/autocomplete/jquery.autocomplete.css" />

  <link rel="stylesheet" href="../../css/reqbuild.css"/>
  <name>请求构建工具</name>
</head>
<body>
  <div class="container-fluid">
    <div class="row">
      <div class="col-xs-12">
        <div class="login-wraper">
          <!-- 登录表单 -->
          <form class="login-form form-inline" onsubmit="return false;" id="loginform">
            <div class="form-group">
              <label contenteditable spellcheck="false" >userName</label>
              <input type="text" class="form-control input-sm" name="userName" placeholder="用户名" value="admin">
            </div>
            <div class="form-group">
              <label contenteditable spellcheck="false">passWord</label>
              <input type="text" class="form-control input-sm" name="passWord"  placeholder="密码" value="admin">
            </div>
            <div class="form-group">
              <label contenteditable spellcheck="false">checkCode</label>
              <input type="text" class="form-control input-sm" name="checkCode" value="11"   placeholder="验证码" >
            </div>
            <div class="form-group">
              <img alt="验证码" src="" id="verifyCode"  class="validate-code">
            </div>
            <button type="button " id="login" class="btn btn-sm btn-primary">登录</button>
            <select name="" id="loginconns">
            </select>
          </form>
          <!-- 登录成功后的显示 -->
          <div class="login-success" id="loginsuccess">
            <span>使用连接</span>
            <b name="useconn">default</b>
            <span name="conninfo">{userName:admin,userPassword:admin,checkCode:11}</span>
            <a href="#" name="exit">退出</a>
          </div>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-xs-4">
        <div class="row">
          <div class="col-xs-2" style="padding-right: 0;">
            <input type="text" id="reqmethod" class="form-control input-sm" placeholder="请求方式" value="POST"/>
          </div>
          <div class="col-xs-10" style="padding-left: 0;">
            <input type="text" id="url" class="form-control input-sm" placeholder="请求路径,以 / 开头,相对于主机的路径"/>
          </div>
        </div>
        <div class="row">
          <div class="col-xs-12">
            <textarea id="columns" class="column-data form-control" placeholder="输入要生成的列,每行一个"  ></textarea>
          </div>
        </div>
      </div>
      <div class="col-xs-8">
        <div class="row">
          <div class="col-xs-9">
            <input type="text" id="reqdatakeyvalue" class="form-control input-sm" placeholder="输入键值对"/>
          </div>
          <div class="col-xs-3">
            <div class="btn-group" id="reqaction">
              <button type="button" event="keyvalue" contentType="application/x-www-form-urlencoded"  class="btn btn-primary btn-sm">请求</button>
              <button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" >
                <span class="caret"></span>
              </button>
              <ul class="dropdown-menu">
                <li><a href="#" event="keyvalue" contentType="application/x-www-form-urlencoded" >键值对</a></li>
                <li><a href="#" event="json" contentType="application/json">json数据</a></li>
                <li><a href="#" event="xml" contentType="text/xml">xml数据</a></li>
              </ul>
            </div>
            <div class="btn-group">
              <button type="button" class="btn btn-danger btn-sm">清空</button>
              <button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" >
                <span class="caret"></span>
              </button>
              <ul class="dropdown-menu">
                <li><a href="#">键值对</a></li>
                <li><a href="#">json数据</a></li>
                <li><a href="#">xml数据</a></li>
              </ul>
            </div>
            <button class="btn btn-sm btn-info" id="databuild">数据构建</button>
          </div>
        </div>
        <div class="row">
          <div class="col-xs-6">
            <textarea id="reqdatajson" class="column-data form-control" placeholder="输入 json 串"></textarea>
          </div>
          <div class="col-xs-6">
            <textarea id="reqdataxml" class="column-data form-control" placeholder="输入 xml 串"></textarea>
          </div>
        </div>
      </div>
    </div>
    <div class="row">
      <table class="table table-striped table-bordered table-condensed generate-column" id="generatecolumns">
        <thead>
        <tr>
          <th>#</th>
          <th>序号</th>
          <th>字段名</th>
          <th>最终值</th>
          <th colspan="11">生成方式</th>
        </tr>
        </thead>
        <tbody>
        </tbody>
      </table>
    </div>
    <div class="open-dialog" id="normaldatadialog">
      
    </div>
    <div class="open-dialog" id="jsonviewdialog">
      
    </div>
  </div>
<script type="text/javascript" src="../../js/requirejs2.1.11-min.js"></script>
<script type="text/javascript" src="../config.js"></script>
  <script type="text/html" id="randomdatatpl">
    {{each columns as column i}}
    <tr columnname="{{column.name}}">
      <td><input type="checkbox" checked  name="notgenerate" /></td>
      <td>{{i + 1}}</td>
      <td>{{column.name}}</td>
      <td><span class="finaly-value">{{column.initValue}}</span></td>
      <td generate="num" ><div class="btn btn-sm btn-white selected" >数字limit<input type="text" value="5" ></div></td>
      <td generate="nums" ><div class="btn btn-sm btn-white " >数字长度<input type="text" value="5" ></div></td>
      <td generate="letters" ><div class="btn btn-sm btn-white " >字母<input type="text" value="5" ></div></td>
      <td generate="strings" ><div class="btn btn-sm btn-white " >混合<input type="text" value="5" ></div></td>
      <td generate="chinese" ><div class="btn btn-sm btn-white " >中文<input type="text" value="5" ></div></td>
      <td generate="username" ><div class="btn btn-sm btn-white" >用户名</div></td>
      <td generate="email" ><div class="btn btn-sm btn-white" >邮件<input type="text" value="5" ></div></td>
      <td generate="date" ><div class="btn btn-sm btn-white" >日期<input type="text" class="date-format" value="yyyy-MM-dd" ></div></td>
      <td generate="timestamp" ><div class="btn btn-sm btn-white" >时间戳</div></td>
      <td generate="idcard" ><div class="btn btn-sm btn-white" >生份证号</div></td>
      <td generate="fixed"  ><div class="btn btn-sm btn-white" >固定值<input type="text" style="width: 140px;" class="fix-value" value="{{column.initValue}}" ></div></td>
    </tr>
    {{/each}}
  </script>
  <script type="text/javascript">
    require(['bootstrap','tools/reqbuild']);
  </script>
</body>
</html>